
export const toGet=(data)=>{
    return {
        type:"GETDETAIL",
        data
    }
}


export function getDetail(id){
    return dispatch=>{
        var url='http://localhost:3000/product/data/'+id;
        return fetch(url,{
            method:'get'
        })
        .then(res=>{
            return res.json()
        })
        .then((data)=>{
            console.log(data)
            dispatch(toGet(data));
        })
    }
}